﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace TD.bom
{
    /// <summary>
    /// Classe de base des template d'objets du jeu
    /// </summary>
    public class TemplateBase
    {
        /// <summary>
        /// Cache des templates
        /// </summary>
        protected static Dictionary<string, TemplateBase> m_cache = new Dictionary<string,TemplateBase>();

        /// <summary>
        /// Obtient un template mis en cache
        /// </summary>
        /// <param name="p_templateName">Nom du template</param>
        /// <returns>Instance de TemplateBase si trouvé, null sinon</returns>
        protected static TemplateBase Get(string p_templateName)
        {
            if (m_cache.ContainsKey(p_templateName))
            {
                return m_cache[p_templateName];
            }

            return null;
        }

    }
}
